package org.example.aienglishapp.dto.login;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.Getter;
import lombok.Setter;

@Setter
@Getter
public class UsernameRegisterDTO {

    // Getter 和 Setter
    @NotBlank(message = "用户名不能为空")
    @Size(max = 20, message = "用户名不能超过20个字符")
    @Pattern(regexp = "^(?!\\d+$).*$", message = "用户名不能为纯数字")
    private String username;

    @NotBlank(message = "密码不能为空")
    private String userpassword;

    // 无参构造函数
    public UsernameRegisterDTO() {}

    @Override
    public String toString() {
        return "UserRegisterDTO{" +
                "username='" + username + '\'' +
                ", userpassword='" + userpassword + '\'' +
                '}';
    }
}